package com.example.AIstudy.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.example.AIstudy.domain.CuoTiJi;
import com.example.AIstudy.domain.Exercise;
import com.example.AIstudy.domain.FalseReason;
import com.example.AIstudy.exception.AIstudyException;
import io.swagger.annotations.ApiParam;
import io.swagger.models.auth.In;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.sql.Timestamp;
import java.util.List;
import java.util.Map;

public interface CuoTiJiService extends IService<CuoTiJi> {

    public IPage<CuoTiJi> findCuoTiJi(Map<String, Object> condition, Integer pageNum, Integer pageSize);

    //获取用户的错题数量
    public int getCuoTiNumByUserID(Integer userID);

    public CuoTiJi getCuoTiDetailByID(Integer cuotiID)throws AIstudyException;

    // 更新错题的批注信息
    public void updateUserComment(Integer cuotiID,String userComment) throws AIstudyException;

    // 更新错题的批注信息
    public void deleteCuoti(Integer cuotiID) throws AIstudyException;

    // 获取某个时间段内的所有标签
    public Map<String, List<Object>> getTagsByTime(Integer userID, Timestamp startTime,Timestamp endTime) throws AIstudyException;

    //更新需要重新巩固的错题
    public void updateRedoCuoti(List<Integer> list);
    //获取需要巩固的错题
    public List<CuoTiJi> queryCuotiForRedo(Integer userID, List<String>category,List<String>field,List<Integer>falseReason);

    public void UpdateUserComment(Integer cuotiID,String userComment) throws AIstudyException;

    public void insertCuoti(CuoTiJi cuoTiJi) throws AIstudyException;

    public void updateCuoti(CuoTiJi cuoTiJi)throws AIstudyException;

    //更新题目巩固的次数信息
    void updateCuotiRedoNum(Integer redoNum,Integer cuotiID);

}
